package com.sjh.commons.mybatis.mate;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;

import java.util.Date;

/**
 * 功能描述
 *
 * @author songjiahao
 * @date 2023/04/07  9:07
 */
public class MybatisMateDataHandler implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
        metaObject.setValue("creatTime",new Date());
        metaObject.setValue("updateTime",new Date());
        metaObject.setValue("status",0);
        metaObject.setValue("delFlag",0);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        metaObject.setValue("updateTime",new Date());
    }
}
